<template>
  <div id="enterprise-pay-info-page" :style="{
      height: (getWinSize().height)+'px'
    }">
    <div class="page-title" :style="{top:(this.getSafeArea().top-4)+'px'}">
      <div id="back-button" @click="$router.push(backUrl)">
        <i href="javascript:void(0)" class="el-icon-arrow-left"></i>
      </div>
      <span>对公支付信息查看</span>
    </div>
    <div v-show="isInit" class="info-box" style="position: relative;" :style="{
      minHeight: '210px'
    }">
      <div class="item">
        <div class="title">商品信息:</div>
        <div class="value">
          <p class="ovd_s" style="display: inline-block; background: #d5d3d3; height: 25px; line-height: 25px; border-radius: 5px; margin-left: 5px; padding: 0px 5px;"
             :style="{
            maxWidth:((getWinSize().width-80)*0.8)+'px'
             }"
             v-for="(item,index) in orderData.productList" :key="index" v-text="item.shopProductName+' 【'+item.model+'】 '+'×'+item.nums"></p>
        </div>
      </div>
      <div class="item">
        <div class="title">商品总额:</div>
        <div class="value b red" v-text="'￥'+ToMoney(orderData.price)"></div>
      </div>
      <div class="item">
        <div class="title">收款银行:</div>
        <div class="value" v-text="bank"></div>
      </div>
      <div class="item">
        <div class="title">收款卡号:</div>
        <div class="value" v-text="bankCard"></div>
      </div>
      <div class="item">
        <div class="title">收款人:</div>
        <div class="value" v-text="companyName"></div>
      </div>
      <div class="item">
        <div class="title">打款备注:</div>
        <div class="value" v-text="payInfo"></div>
      </div>
    </div>

    <div align="center" style="height: 100px; line-height: 100px;">
      <el-button size="medium" type="primary" @click="$router.push(backUrl)">查看订单</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'EnterprisePayInfo',
  data:function () {
    return {
      isInit:false,
      backUrl:'/',
      // productList:demoData.chooseProductList,
      price:1050,
      bank:'工商银行',
      companyName:'赵斐',
      bankCard:'62366633331133311',
      infoNumber:'166694',
      orderData:{
        price:0,
        productList:[
          {name:'',nums:0}
        ]
      },
      payInfo:''
    }
  },
  mounted () {
    let $this=this
    if(this.$route.query.type==='order' || this.$route.query.type==='orderMore'){
      $this.backUrl='/OrderList'
      $this.orderData=JSON.parse(localStorage.getItem('PaySuccessOrderData'))
      if ($this.$route.query.type==='orderMore'){
        const PayMoreOrderId = localStorage.getItem('PayMoreOrderId');
        this.payInfo=PayMoreOrderId
        $this.MyRequest($this.ApiDoNameMember+'Order/getOrderMorePrice',{
          orderMoreId:PayMoreOrderId.replace('M-','')
        },function (price) {
          $this.orderData.price=price
          $this.isInit=true
          $this.$forceUpdate()
        })
      }else{
        this.isInit=true
        this.payInfo=this.$route.query.orderNo
      }
    }
    this.getbank()
  },
  methods:{
    getbank:function () {
      let $this=this
      $this.MyRequest($this.ApiDoNameCommon+'Public/getSystemBank',{},function (data) {
        $this.bank=data.bank
        $this.companyName=data.companyName
        $this.bankCard=data.bankCard
        $this.$forceUpdate()
      })
    }
  }
}
</script>
